/**
 * Version 17 mrt 2008 - initial version
 */
package audioreaper.tools;


/**
 * <code>ArrayWaveForm</code>.
 *
 * @author <a href="mailto:vincent@nazarene.nl">Vincent van Beveren</a>
 *
 */
public class ArrayWaveForm implements WaveForm {

	private int[] _samples;
	
	public ArrayWaveForm(int[] samples) {
		if (samples == null) {
			throw new NullPointerException("'samples' may not be null");
		}
		if (samples.length == 0) {
			throw new IllegalArgumentException("'samples' may not be zero-length");
		}
		_samples = samples;
	}
	
	public int getLength() {
		return _samples.length;
	}

	public int getSample(int pos) {
		return _samples[pos];
	}

}
